﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using OpenSource.Controls;

namespace InputFormTestUI
{
    public partial class _default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //ddlTest.DataTextField = "Id";
            //ddlTest.DataValueField = "RowwNumber";

            //ddlTest.DataSource = GetSource();
            //ddlTest.DataBind();
            if (!IsPostBack)
            {
                this.InputForm1.DataSource = GetSource(); // New();
                this.InputForm1.DataBind();
            }
            //this.grdTest.DataSource = GetSource();
            //this.grdTest.DataBind();
        }





        private DataTable GetSource()
        {
            DataTable table = new DataTable();

            table.Columns.Add(new DataColumn("Id", typeof(string)));
            table.Columns.Add(new DataColumn("RowwNumber", typeof(string)));

            for (int counter = 0; counter < 1; counter++)
            {
                DataRow dr = table.NewRow();
                dr[0] = Guid.NewGuid().ToString();
                dr[1] = "This row no :- " + counter.ToString();

                table.Rows.Add(dr);
            }

            return table;
        }

        private DataTable GetSourceFor10()
        {
            DataTable table = new DataTable();

            table.Columns.Add(new DataColumn("Id", typeof(string)));
            table.Columns.Add(new DataColumn("RowwNumber", typeof(string)));

            for (int counter = 0; counter < 10; counter++)
            {
                DataRow dr = table.NewRow();
                dr[0] = Guid.NewGuid().ToString();
                dr[1] = "This row no :- " + counter.ToString();

                table.Rows.Add(dr);
            }

            return table;
        }    
   
        protected void InputForm1_RowChanged(object sender, EventArgs e)
        {
            //InputForm frm = (InputForm) sender;
            
            //InputFormRow row = (InputFormRow) frm.Rows[2];
            ////SelectCell cell = (SelectCell) row.Cells[1];

            ////cell.DataValueField = "Id";
            ////cell.DataTextField = "RowwNumber";

           


            ////SelectCell cell1 = new SelectCell();
            ////cell1.DataValueField = "Id";
            ////cell1.DataTextField = "StandardName";
            ////cell1.DataSourceName = "test21";
            ////cell1.CanUpdate = true;


            ////row.Cells.Add(cell1);

            //this.InputForm1.DataSource = GetSourceFor10();
            //this.InputForm1.DataBind();
        }


       

        

    }
}